
/*
	Copyright (C) 2009 Salil Bhagurkar
	
	This file is part of ViSE
	
	ViSE is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.
	
	ViSE is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU Lesser General Public License for more details.
	
	You should have received a copy of the GNU Lesser General Public License
	along with ViSE.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef _APP_H_
#define _APP_H_


#define NR_NAMES 20

struct app {
	//The name of the app is the same as the node_fs name which hosts this application
	char class_name[FS_NAME_LEN];
	struct node *start_node;
	struct node *temp_node;
	struct node_fs *current_application;
	struct node_fs *fs; //The hosting node_fs
};

int create_vtask(char *name, int (*init)(struct node_fs *), struct node *begin);
int switch_vtask(struct node_fs *to);


int app_print_namespace(char *location);
int app_create(char *location, char *name);
int app_add_name(char *name, struct node *addr);
struct node *app_find_node(char *name);
int app_attach_temp(struct node *node);
void app_run(char *location);
void app_set_start_node(struct node *start_node);

#endif
